home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group92c.txt / 000069_icon-group-sender _Mon Nov 9 15:02:35 1992.msg < prev    next >
Internet Message Format  |  1993-01-04  |  2KB

  1. Received: by cheltenham.cs.arizona.edu; Mon, 9 Nov 1992 18:50:54 MST
  2. Date: Mon, 9 Nov 1992 15:02:35 MST
  3. From: "Kenneth Walker" <kwalker>
  4. Message-Id: <199211092202.AA25256@optima.cs.arizona.edu>
  5. To: icon-group
  6. Subject: Re: file scanning
  7. Status: R
  8. Errors-To: icon-group-errors@cs.arizona.edu
  9.  
  10. > Date: 5 Nov 92 04:55:57 GMT
  11. >
  12. > Ken, Ralph, Clint, etc.:  How hard would it really be to implement
  13. > file scanning?
  14.  
  15. Kelvin Nilsen's Conicon has a stream data type the subsumes files and
  16. supports a type of scanning. His scanning doesn't have tab() and move()
  17. instead it has probe() and advance() which aslo replace read(). While
  18. you can backtrack during scanning, I think there are limitations on
  19. explicitly scanning backwards. He allows for infinite streams along the
  20. lines of Unix pipes. I know he does some careful buffering to make
  21. things work.
  22.  
  23. For files that support seek(), it should be possible to do scanning
  24. with buffering as you suggested. It means that every file must be
  25. buffered within the Icon run-time system and all string analysis
  26. functions have to be changed to work on files and extend the buffer
  27. when needed. Note that seeking backwards in a file using translation
  28. mode on systems that have multi-character line termination (like
  29. MS-DOS) may be a little tricky.
  30.  
  31. There is the question of where you put the buffer. Putting it in the
  32. string region makes some string handling operations easier; portions
  33. of the input are normal strings. However, it may be necessary to copy
  34. the buffer to the end of the region to extent it. How do you decide how
  35. much to copy? Suppose you backtrack past a point where you did a read-ahead
  36. to extend the buffer; you probably don't want to loose the read-ahead.
  37. How do you handle that? I haven't look closely at Kelvin's work in
  38. several years, so I don't recall how he does these things. But it doesn't
  39. sound trivial.
  40.  
  41.   Ken Walker  kwalker@cs.arizona.edu   uunet!arizona!kwalker
  42.